package com.zt.controller;

import com.zt.pojo.CountData;
import com.zt.pojo.JobOption;
import com.zt.pojo.Result;
import com.zt.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/report")
public class ReportController {
    @Autowired
    private ReportService reportService;
    //统计员工职位
    @GetMapping("/empJobData")
    public Result getEmpJobData(){
        JobOption joblist = reportService.getEmpJobData();
        return Result.success(joblist);
    }

    //统计员工性别
    @GetMapping("/empGenderData")
    public Result getEmpGenderData(){
        List<Map<String, Object>> genderlist = reportService.getempGenderDate();
        return Result.success(genderlist);
    }

    //统计学员学历
    @GetMapping("/studentDegreeData")
    public Result getStudentDegreeData(){
        List<Map<String, Object>> degreeList = reportService.getStudentDegreeData();
        return Result.success(degreeList);
    }

    //统计班级人数
    @GetMapping("/studentCountData")
    public Result getStudentCountData(){
        CountData countData= reportService.getStudentCountData();
        return Result.success(countData);
    }
}
